package com.chenailin.www.common;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class Schedule {
    // 时间段编号 -> 时间描述
    public static final Map<Integer, String> TIME_SLOTS = new LinkedHashMap<Integer, String>(){{
        put(1, "08:00-09:00");
        put(2, "09:00-10:00");
        put(3, "10:00-11:00");
        put(4, "14:00-15:00");
        put(5, "15:00-16:00");
        put(6, "16:00-17:00");
    }};

    // 获取有效的时间段编号列表
    public static List<Integer> getValidSlots() {
        return new ArrayList<>(TIME_SLOTS.keySet());
    }

    // 根据编号获取时间段描述
    public static String getTimeBySlot(int slotNumber) {
        return TIME_SLOTS.getOrDefault(slotNumber, "无效时间段编号");
    }

    public static boolean isValidSlot(int slot) {
        return TIME_SLOTS.containsKey(slot);
    }

    public static String getDisplayTime(int slot) {
        return TIME_SLOTS.getOrDefault(slot, "未知时间段");
    }
}